FIG. 1 is a block diagram of a typical video codec 30 having a main processor 32. The main processor 32 encodes an incoming video 34 by using intra-coded frames (I-Frames) 36 to generate one or more predictive-coded frames (P-Frames) 38. An I-Frame 36 is typically generated by compressing a single frame of the incoming video signal. The P-Frame 38 then provides more compression for subsequent frames by making reference to the data in the previous frame instead of compressing an entire frame of data. For instance, a P-Frame 38 may only include data indicating how the pixel data has changed from the previous frame (Δ Pixels) and one or more motion vectors to identify the motion between frames. Alternatively, the video codec 30 may function as a decoder, receiving I-frame 36 and P-Frame data to generate a video output 34.
In order to generate a P-Frame 38 during encoding operation, the main processor 32 typically compares 16×16 macroblocks of pixel data from a current frame 40 with 16×16 macroblocks of data from a previously generated frame of data, referred to as a reference frame 42. The main processor 32 attempts to find the best fit pixel match between each macroblock in the current frame 40 and each macroblock in the reference frame 42. In this way, the P-Frame only needs to include the small pixel difference (Δ Pixels) between the matched macroblocks and a motion vector to identify where the macroblock was located in the reference frame 42. An example of this process is further illustrated in FIGS. 2A and 2B.
FIG. 2A depicts an example macroblock 50 within a current frame 52 of pixel data. Also shown in FIG. 2A is a predicted motion vector (PMV) 54 that provides an estimate of where the macroblock 50 was likely located in the reference frame. As illustrated, a motion vector 54 typically points from a corner pixel of the current macroblock 50 to a corner pixel of the reference macroblock 56. Methods for calculating a predicted motion vector (PMV) 54 are known in the art and are beyond the scope of the instant application.
Based on the predicted motion vector (PMV) 54, a search area 60 is selected within the reference frame 62, as illustrated in FIG. 2B. As shown, the search area 60 may include all of the macroblocks surrounding the reference macroblock 56 identified by the predicted motion vector (PMV) 54. The current macroblock 50 is then compared with reference macroblocks at every pixel location within the search area 60 in order to identify the motion vector location within the search area 60 with the closest pixel match. This comparison is typically performed by calculating a sum of absolute differences (“SADs”) for each motion vector location within the search area 60, and selecting the motion vector location with the lowest SAD as the best match.
The encoding procedures described above may be reversed as would be recognized by one skilled in the art, such that the video codec 30 may receive I-frame 36 and P-frame 38 input data and recreate a video output 34 via main processor 32 calculations. The calculations performed by a typical main processor to identify the best fit pixel match between a current macroblock and a search area in a reference frame as well as regeneration of video from stored I-frames and P-frames are often some of the most clock cycle, resource, and power consuming processes performed by a video codec.